Skip to content

MQE-2047: Jenkins Pipeline - Static Check Options #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 11, 2020
Merged

Conversation

KevinBKozan
Copy link
Contributor

Description

  • static checks now check for existance of a staticRuleset.json under wither dev/tests/acceptance or dev in case of embedded/standalone respectively.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/verification tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

- added ruleset reading functionality to static-checks command
- added example staticRuleset.json to framework.
- Fixed project root
-Fixed to use TESTS_BP, should be good now.
@coveralls
Copy link

coveralls commented May 7, 2020

Coverage Status

Coverage remained the same at 53.257% when pulling 6d40406 on MQE-2047 into 1de7456 on develop.

- Added docs
- Fixed static check errors
- Added proper static checks to sample file.
@KevinBKozan KevinBKozan requested a review from dobooth May 7, 2020 14:46
Copy link
Contributor

@soumyau soumyau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments.
Couldn't find static check error output files in build http://10.234.156.139:8080/job/Functional-Tests-CE/3200/console. Is it because the build failed?

*/
private function parseRulesetJson()
{
$pathToRuleset = TESTS_BP . DIRECTORY_SEPARATOR . "staticRuleset.json";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the file staticRuleset.json even be added to MFTF? Because, again updates to this file will need a new MFTF version. Reading from this path works for both standalone and embedded -

const DEV_TESTS_DIR = 'dev/tests/acceptance/';        
$devTestsPath = FilePathFormatter::format(MAGENTO_BP) . self::DEV_TESTS_DIR;
$pathToRuleset = $devTestsPath . DIRECTORY_SEPARATOR . "staticRuleset.json";

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment, TESTS_BP is set as following:

  • If we detect we are attached to Magento (either by composer or MAGENTO_BP), it's dev/tests/acceptance
  • If we are not attached, it's just dev/ to point towards MFTF standalone dev directory

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in standalone mode, with latest code, it tries to read staticRuleSet.json from mftf's \dev, doesn't find it, and executes all static checks instead. Shouldn't standalone also read from attached magento's dev/tests/acceptance?

However in case mftf is not attached at all i.e MAGENTO_BP is not set in .env, it again tries to read file from mftf's \dev, doesn't find it and executes all static checks, which seems correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I understand better now, let me try and reproduce scenario 1.

soumyau
soumyau previously approved these changes May 11, 2020
Copy link
Contributor

@soumyau soumyau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@dobooth dobooth added the DOC label May 11, 2020
@KevinBKozan KevinBKozan merged commit 846f9c6 into develop May 11, 2020
@tomreece tomreece deleted the MQE-2047 branch July 27, 2020 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants